<!DOCTYPE html>
<html>

<head>
	<meta charset="utf-8">
	<title>服务定制信息</title>
	<meta name="renderer" content="webkit">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<meta name="apple-mobile-web-app-status-bar-style" content="black">
	<meta name="apple-mobile-web-app-capable" content="yes">
	<meta name="format-detection" content="telephone=no">
	<link rel="stylesheet" href="../plugins/layui/css/layui.css" media="all" />
	<link rel="stylesheet" href="../plugins/font-awesome/css/font-awesome.min.css">
</head>

<body>
	<div style="margin: 15px;">
		<blockquote class="layui-elem-quote">
			<a href="javascript:history.go(-1);;" class="layui-btn layui-btn-small" id="add">
					<i class="layui-icon">&#xe608;</i> 返回
				</a>
		</blockquote>

		<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
			<legend>订单信息</legend>
		</fieldset>

		<form class="layui-form" action="">
			<div id="content">

			</div>
		</form>
	</div>

	<!--模板-->
	<script type="text/html" id="tpl">
		<div class="layui-form-item">
			<label class="layui-form-label">id</label>
			<div class="layui-input-block">
				<input type="text" value="<%==result.spid %>" disabled="true" name="title" lay-verify="title" autocomplete="off" class="layui-input">
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">商品类型</label>
			<div class="layui-input-block">
				<input type="text" value="<%==result.productType %>" disabled="true" name="username" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input">
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">商品</label>
			<div class="layui-input-inline">
				<a style="line-height: 38px;" onclick="check(<%==result.productId %>,'<%==result.productType %>')">查看商品</a>
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">订单号</label>
			<div class="layui-input-inline">
				<input type="text" value="<%==result.ordersNum %>" disabled="true" name="email" lay-verify="email" autocomplete="off" class="layui-input">
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">状态</label>
			<div class="layui-input-inline">
				<%
				 	var status = null;
					switch(result.ordersState){
						case 1: status = "未支付";break;
						case 2: status ="待处理";break;
						case 3: status = "待使用";break;
						case 4: status ="已完成";break;
						case 5: status ="退款中";break;
						case 6: status ="已退款";break;
						case 7: status ="已取消";break;
					}
				 %>
				 <input type="text" value="<%==status%>" disabled="true" name="email" lay-verify="email" autocomplete="off" class="layui-input">
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">创建时间</label>
			<div class="layui-input-inline">
				<input type="text" value="<%==result.ctime %>" disabled="true" name="email" lay-verify="email" autocomplete="off" class="layui-input">
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">活动时间</label>
			<div class="layui-input-inline">
				<input type="text" value="<%==result.activityTime %>" disabled="true" name="email" lay-verify="email" autocomplete="off" class="layui-input">
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">联系人号码</label>
			<div class="layui-input-inline">
				<input type="text" value="<%==result.contactPhone %>" disabled="true" name="email" lay-verify="email" autocomplete="off" class="layui-input">
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">联系人姓名</label>
			<div class="layui-input-inline">
				<input type="text" value="<%==result.contactUser %>" disabled="true" name="email" lay-verify="email" autocomplete="off" class="layui-input">
			</div>
		</div>
		<div class="layui-form-item layui-form-text">
			<label class="layui-form-label">备注</label>
			<div class="layui-input-block">
				<textarea  disabled="true"  class="layui-textarea"><%==result.contactNotes%></textarea>
			</div>
		</div>
	</script>

	<script type="text/javascript" src="../plugins/layui/layui.js"></script>
	<script type="text/javascript" src="../js/jquery.min.js"></script>
	<script type="text/javascript" src="../js/template.js"></script>
	<script type="text/javascript" src="../js/publish.js"></script>
	<script type="text/javascript" src="../js/jquery.min.js"></script>
	<script>
		var data;
		var cuid = getUrlParam("id");

		$.ajax({
			url: '/admin/orders/get/' + cuid,
			dataType: 'json',
			async: false,
			success: function(response) {
				if (response.code == 200) {
					data = response;
				}
			}
		});
		var html = template('tpl', data);
		document.getElementById('content').innerHTML = html;
		var layer;
		layui.use(['layer'], function() {

		 layer = layui.layer;

		});
		function check(id, type) {
			var base = "http://" + document.domain + ":8080/";
			if (type == "场地") {
				var url = base + "site/detail?id=" + id;
			}
			if (type == "聚会套餐") {
				var url = base + "meal/detail?id=" + id;
			}
			if (type == "二级服务") {
				var url = base + "service/detail?sid=" + id;
			}
			layer.open({
				title: "查看商品",
				type: 2,
				content: url,
				area: ["350px", "600px"],
			});
		}
	</script>
</body>

</html>
